package com.ssm.hj.controller;

import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.hj.search.PsychologySearch;
import com.ssm.hj.service.PsychologyService;
import com.ssm.pojo.Psychology;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class PsychologyController {
    @Resource
    private PsychologyService psychologyService;
    @RequestMapping("/hj/queryPsychologyAll")
    public PageInfo<Psychology> queryPsychologyAll(@RequestBody Page<PsychologySearch> page) throws Exception{
        return this.psychologyService.queryPsychologyAllService(page);
    }
    @RequestMapping("/hj/savePsychology")
    public int savePsychology(@RequestBody Psychology psychology) throws Exception{
        return this.psychologyService.savePsychologyService(psychology);
    }
}
